# Usage:
# ------
#
# 1. Place this file under /etc/systemd/system/
# 2. Adjust the paths and other settings below if necessary
# 3. Activate using: sudo systemctl enable fuseki.service

[Unit]
Description=Fuseki database for DOKK
After=network.target

[Service]
# Edit environment variables to match your installation
Environment=FUSEKI_HOME=/opt/fuseki/
Environment=FUSEKI_BASE=/opt/fuseki/run/
# Edit the line below to adjust the amount of memory allocated to Fuseki
Environment=JVM_ARGS=-Xmx3G

# Edit to match your installation
ExecStart=/opt/fuseki/fuseki-server

# Run as user "fuseki"
User=fuseki
Group=fuseki

# If set to on-abort, the service will be restarted only if the service process
# exits due to an uncaught signal not specified as a clean exit status. If set
# to on-watchdog, the service will be restarted only if the watchdog timeout
# for the service expires. If set to always, the service will be restarted
# regardless of whether it exited cleanly or not, got terminated abnormally by
# a signal, or hit a timeout.
Restart=always

# Configures the time to sleep before restarting a service (as configured with
# Restart=). Takes a unit-less value in seconds, or a time span value such as
# "5min 20s". Defaults to 100ms.
RestartSec=1

# Takes a list of exit status definitions that, when returned by the main service
# process, will be considered successful termination, in addition to the normal
# successful exit code 0 and the signals SIGHUP, SIGINT, SIGTERM, and SIGPIPE.
# Java processes exit with status 143 when terminated by SIGTERM, this
# should be considered a successful shutdown
SuccessExitStatus=143

### By default, the service logs to journalctl only.
### If additional logging to a file is required, uncomment the following three lines
# StandardOutput=syslog
# StandardError=syslog
# SyslogIdentifier=dokk

### This logs to syslog. If, e.g., rsyslogd is used, you can provide a file
### /etc/rsyslog.d/dokk.conf, consisting of the following two lines (uncommented)
### if $programname == 'dokk' then /var/log/dokk/stderrout.log
### if $programname == 'dokk' then stop

[Install]
WantedBy=multi-user.target
